/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.client2server;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;

/**
 *
 * @author ChengJiLi
 */
public class Login {
    @Protobuf(fieldType = FieldType.STRING, order=1, required = false)
    public String userID;
    @Protobuf(fieldType = FieldType.STRING, order=2, required = false)
    public String pWD;
    @Protobuf(fieldType = FieldType.STRING, order=3, required = false)
    public String code;
    @Protobuf(fieldType = FieldType.UINT32, order=4, required = false)
    public int type;
    public void setUserID(String userID){
        this.userID=userID;
    }
    public String getUserID(){
        return this.userID;
    }
    public void setPWD(String pWD){
        this.pWD=pWD;
    }
    public String getPWD(){
        return this.pWD;
    }
    public void setCode(String code){
        this.code=code;
    }
    public String getCode(){
        return this.code;
    }
    public void setType(int type){
        this.type=type;
    }
    public int getType(){
        return this.type;
    }
    //@override
    @Override
    public String toString(){
        return getClass().getName()+":"+"userID:"+userID+"  type:"+type+" PWD:"+pWD+" code:"+code;
    }
    public byte[] EnCode(Login msg) throws IOException{
        Codec<Login> Lcode = ProtobufProxy.create(Login.class);
        return Lcode.encode(msg);
    }
    public Login DeCode(byte[] data) throws IOException{
        Codec<Login> Lcode = ProtobufProxy.create(Login.class);
        return Lcode.decode(data);
        
    }
}
